package jdk.thread.threadpool;

import java.util.concurrent.*;

public class ThreadPoolExecutorTest {


    public static void main(String[] args) throws InterruptedException {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 10, 0l, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
        executor.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello world!");
            }
        });
        executor.shutdown();
        executor.shutdownNow();
        executor.awaitTermination(1000l, TimeUnit.MILLISECONDS);
        executor.purge();
    }
}
